package cn.lastjune.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.lastjune.dao.SummaryDao;
import cn.lastjune.pojo.Summary;
import cn.lastjune.pojo.SummaryId;
import cn.lastjune.service.SummaryService;
import cn.lastjune.util.Page;

@Service
@Transactional
public class SummaryServiceImpl implements SummaryService
{
    @Autowired
    SummaryDao dao;

    @Override
    public Page<Summary> getAll(Page<Summary> page)
    {
        return dao.getPageAll(page);
    }

    @Override
    public Summary getSummaryById(SummaryId id)
    {

        return dao.get(id);
    }

    @Override
    public void insertSummary(Summary entity)
    {
        dao.add(entity);
    }

    @Override
    public void deleteSummary(SummaryId id)
    {
        dao.delete(id);
    }

    @Override
    public void updateSummary(Summary entity)
    {
        dao.update(entity);
    }

}
